package com.cwm.consumer;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import java.util.function.Consumer;

/**
 * 消费
 */
@Service
public class ConsumerService {

    // Consumer消费函数，在stream当中用来当中接受消息者
    @Bean
    public Consumer<String> sink() {
        return message -> {
            System.out.println("----------------消费:" + message + "---------------");
        };
    }

}
